package org.inote.controller;

import org.inote.pojo.tablePojo.Specialty;
import org.inote.service.SpecialtyService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.xml.ws.soap.Addressing;
import java.util.List;

@Controller
@RequestMapping("/specialty")
public class SpecialtyController {

    @Resource
    private SpecialtyService specialtyService;

    /**
     * 点击写博客页面，查询出可选的文章类型
     * 返回给addNote.jsp
     * @return
     */
    @RequestMapping("/getSpecialty")
    public String getAllSpecialty(Model model)
    {
        List<Specialty> specialtyList = specialtyService.queryAll();
        model.addAttribute("specialtyList",specialtyList);
        return "addNote";
    }
}
